/**
 * 2017年9月8日
 */
package interview;
import java.util.*;
/**
 * @author Alex
 *
 */
public class JD9_8 {
	public static void main(String[] args) throws Exception{
//		new Student();
		//P2 S1 P1 P3 S2 S3
//   meta class
//		Class.forName("jdk.Person");
//		Class.forName("jdk.Student");
		System.out.println(Student.s);
		List<Class<? extends Person>> l = new ArrayList<>();
		l.add(Person.class);
		l.add(Student.class);
		String  s = "h";
		Object o = s;
		System.out.println(s instanceof String);
		System.out.println(s.getClass());
		System.out.println(o.getClass() == String.class);
	}
}
class Person{
	{
		System.out.println("P1");
	}
	static{
		System.out.println("P2");
	}
	public Person(){
		System.out.println("P3");
	}
}
class Student extends Person{
	public final static String s  = "hello";
	static {
		System.out.println("S1");
	}
	
	{
		System.out.println("S2");
	}

	public Student() {
		System.out.println("S3");
	}
}